pub fn hextostring(hex: &[u8]) -> String {
    hex.iter()
        .map(|&b| format!("{:02X}", b))
        .collect::<Vec<_>>()
        .join("")
}
